<?php include('login_validation.php'); ?>

<?php

	include('functions.php');
	
	$bgcolor = "#229CBA";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

	<title>CONGRESS ADMIN - LIST ABSTRACTS</title>

	<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="accordion/style.css" rel="stylesheet" type="text/css" media="screen" />

	<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

	<script src="accordion/accordian.pack.js" language="javascript" type="text/javascript">
	</script>

	<script src="ajax_functions.js" language="javascript" type="text/javascript">
	</script>
	
	<style>
		body {
			padding: 0px;
			margin: 0px;
		}
		
		.bodybg {
			background: <?php echo $bgcolor; ?>
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $bgcolor; ?>', endColorstr='#FFFFFF');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $bgcolor; ?>), to(#FFFFFF));
			background: -moz-linear-gradient(top,  <?php echo $bgcolor ?>,  #FFFFFF);
			width:100%;
			height: 600px;
		}
	</style>

	<script type="text/javascript" src="jscolor/jscolor.js"></script>
	<script type="text/javascript" src="tiny_mice.js"></script>
</head>

<body>

	<div align="center" class="bodybg">

		<?php include('admin_header.php'); ?>

		<?php include('admin_menu.php'); ?>

		<?php include('congress_select.php'); ?>

	    <div id="basic-accordian" style="background-color: white;">

			<?php if (getValor('ID_CONGRESS') != "") { ?>
				
				<?php
					$abstracts = obtenerAbstractsPorCongressYNombre(getValor('ID_CONGRESS'), "");
					$cantAbstracts = obtenerCantidadAbstractsPorCongressYNombre(getValor('ID_CONGRESS'), "");
				?>

				<?php if ($cantAbstracts) { ?>

				<?php 
				
					$uncolor = "#FFFFFF";
					$otrocolor = "#F8F8F8";
					$bgcolortr = $uncolor;
				
				?>

				<?php while ($row_abstract = mysql_fetch_assoc($abstracts)) { ?>
				<table width="100%" cellpadding="5" cellspacing="0">
					<tr bgcolor="<?php echo $bgcolortr; ?>" style="height: 25px;">
						<td width="50%">
							<?php echo $row_abstract['TITLE']; ?>
						</td>
						<td width="30%">
							Show
							<input type="radio" <?php if ($row_abstract['SHOW_ABSTRACT'] == 1) { echo "checked='checked'"; } ?> 
							 	onclick="updateShowAbstract(<?php echo $row_abstract['ID_ABSTRACT']; ?>, 1)"
								name="SHOW_<?php echo $row_abstract['ID_ABSTRACT']; ?>" /> YES
							<input type="radio" <?php if ($row_abstract['SHOW_ABSTRACT'] == 0) { echo "checked='checked'"; } ?> 
								onclick="updateShowAbstract(<?php echo $row_abstract['ID_ABSTRACT']; ?>, 0)"
								name="SHOW_<?php echo $row_abstract['ID_ABSTRACT']; ?>" /> NO
						</td>
						<td width="10%">
							<input type="button" value="Edit" onclick="window.location='abstract_proceeding_edit.php?ID_CONGRESS=<?php echo getValor('ID_CONGRESS') ?>&ID_ABSTRACT=<?php echo $row_abstract['ID_ABSTRACT']; ?>';" />
						</td>
						<td width="10%">
							<input type="button" value="Delete" 
							onclick="if (confirm('Are you sure you want to delete <?php ECHO $row_abstract['TITLE']; ?>')) { window.location='abstract_delete.php?ID_CONGRESS=<?php echo getValor('ID_CONGRESS') ?>&ID_ABSTRACT=<?php echo $row_abstract['ID_ABSTRACT']; ?>'};" />
						</td>

					</tr>
				</table>
				<?php if ($bgcolortr == $uncolor) { $bgcolortr = $otrocolor; } else { $bgcolortr = $uncolor; } ?>
				<?php } ?>

				
				<?php } else { ?>
					No abstracts found
				<?php } ?>
				
			<?php } else { ?>
				No Congress Selected
			<?php } ?>
			
	  </div>
		
	</div>

</body>
</html>
